package org.msd.controller;
import org.apache.ibatis.annotations.Param;
import org.msd.model.backstage;
import org.msd.service.iml.BackstageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("back")
public class Administratorlogin {
    @Autowired
    private BackstageService backstageService;
    /*
    管理员验证
     */
    @RequestMapping("back")
    @ResponseBody
    public backstage checklogin(@Param("account")String account, @Param("security")String security, HttpSession httpSession){
    backstage backstage=backstageService.Administratorverification(account,security);
   if (backstage!=null){
     httpSession.setAttribute("back",backstage);
     return backstage;
   }else {

   }
   return null;
     }
@RequestMapping("dashboard")
    public String add(){
        return "index";
}
@RequestMapping("supporter")
    public String Jumptoadmin(){
        return "back-stage";
          }
}
